package classtest_domain;

/**
 * @version 1.0
 * @auther liquan
 * @date 2025/3/20 0:13
 * @description
 */
public class Book {
    // 私有属性
    private Integer id;
    private String title; // 书名
    private String author; // 作者
    private double price; // 价格
    private Integer sales; // 销量
    private Integer stock; // 库存

    // getinfo返回书本对象
    public String getinfo(){
        return"id:" + id + ",书名：" + title + ",作者：" + author + ",价格：" + price + ",销量：" + sales + ",库存：" + stock;
    }

    // 无参
    public Book() {
    }
    // 有参
    public Book(Integer id, String title, String author, double price, Integer sales, Integer stock) {
        this.id = id;
        this.title = title;
        this.author = author;
        this.price = price;
        this.sales = sales;
        this.stock = stock;
    }

    // getter  and  setter

    public Integer getId() {
        return id;
    }

    public String getTitle() {
        return title;
    }

    public String getAuthor() {
        return author;
    }

    public double getPrice() {
        return price;
    }

    public Integer getSales() {
        return sales;
    }

    public Integer getStock() {
        return stock;
    }


    public void setId(Integer id) {
        this.id = id;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public void setSales(Integer sales) {
        this.sales = sales;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }
}
